package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * <p>
 * 实体类
 * 仓库
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_warehouse")
@ApiModel(value = "Warehouse", description = "仓库")
public class WarehouseEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @NotEmpty(message = "编码不能为空", groups = {Save.class})
    @Length(max = 50, message = "编码长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @NotEmpty(message = "名称不能为空", groups = {Save.class})
    @Length(max = 50, message = "名称长度不能超过50")
    @TableField(value = "name")
    private String name;
    /**
     * 类型 中转仓:ZZ、加工仓:JG、储备仓:CB、冷藏仓:LC
     */
    @ApiModelProperty(value = "类型 中转仓:ZZ、加工仓:JG、储备仓:CB、冷藏仓:LC")
    @NotEmpty(message = "类型 中转仓:ZZ、加工仓:JG、储备仓:CB、冷藏仓:LC不能为空", groups = {Save.class})
    @Length(max = 10, message = "类型 中转仓:ZZ、加工仓:JG、储备仓:CB、冷藏仓:LC长度不能超过10")
    @TableField(value = "type")
    private String type;

    @ApiModelProperty(value = "省市区描述")
    @TableField(value = "location")
    private String location;
    /**
     * 省
     */
    @ApiModelProperty(value = "省")
    @NotEmpty(message = "省不能为空", groups = {Save.class})
    @Length(max = 10, message = "省长度不能超过10")
    @TableField(value = "province")
    private String province;
    /**
     * 市
     */
    @ApiModelProperty(value = "市")
    @NotEmpty(message = "市不能为空", groups = {Save.class})
    @Length(max = 10, message = "市长度不能超过10")
    @TableField(value = "city")
    private String city;
    /**
     * 区
     */
    @ApiModelProperty(value = "区")
    @NotEmpty(message = "区不能为空", groups = {Save.class})
    @Length(max = 10, message = "区长度不能超过10")
    @TableField(value = "area")
    private String area;
    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址")
    @Length(max = 100, message = "详细地址长度不能超过100")
    @TableField(value = "address")
    private String address;
    /**
     * 面积
     */
    @ApiModelProperty(value = "面积")
    @TableField(value = "surface")
    private java.math.BigDecimal surface;
    /**
     * 负责人id
     */
    @ApiModelProperty(value = "负责人id")
    @TableField(value = "person_id")
    private Long personId;
    /**
     * 负责人姓名
     */
    @ApiModelProperty(value = "负责人姓名")
    @NotEmpty(message = "负责人姓名不能为空", groups = {Save.class})
    @Length(max = 10, message = "负责人姓名长度不能超过10")
    @TableField(value = "person_name")
    private String personName;
    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Length(max = 20, message = "联系电话长度不能超过20")
    @TableField(value = "phone")
    private String phone;
    /**
     * 库区数量
     */
    @ApiModelProperty(value = "库区数量")
    @TableField(value = "included_num")
    private Integer includedNum;
    /**
     * 状态 0 停用 1启用
     */
    @ApiModelProperty(value = "状态 0 停用 1启用")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
